package com.zxgj.datadirect.service.impl;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.zxgj.datadirect.entity.DataDirectCatalog;
import com.zxgj.datadirect.mapper.DataDirectCatalogMapper;
import com.zxgj.datadirect.service.DataDirectCatalogService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * 数据目录服务实现类
 */
@Service
public class DataDirectCatalogServiceImpl extends ServiceImpl<DataDirectCatalogMapper, DataDirectCatalog> 
    implements DataDirectCatalogService {

    @Autowired
    private DataDirectCatalogMapper dataDirectCatalogMapper;

    @Override
    public boolean existsByCatalogCode(String catalogCode) {
        return dataDirectCatalogMapper.existsByCatalogCode(catalogCode) > 0;
    }

    @Override
    public int updateByCatalogCode(DataDirectCatalog catalog) {
        return dataDirectCatalogMapper.updateByCatalogCode(catalog);
    }

    @Override
    public Page<DataDirectCatalog> selectCatalogPage(
            Page<DataDirectCatalog> page,
            String orgCode,
            Integer dataType) {
        return dataDirectCatalogMapper.selectCatalogPage(page, orgCode, dataType);
    }
}
